﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"   Inherits="System.Web.Mvc.ViewPage<Car>" %>
<%@ Import Namespace="CarTrackr.Business"%>
 

<asp:Content ID="detailsContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Details for <%=Html.Encode(Model.Make)%> <%=Html.Encode(Model.Model)%> - <%=Html.Encode(Model.LicensePlate)%></h2>

    <h3>General details</h3>
    
    <table border="0" cellpadding="2" cellspacing="0" class="vertical">
    <tr>
        <th>Make</th>
        <td><%=Html.Encode(Model.Make ?? "Unknown")%></td>
    </tr>
    <tr>
        <th>Model</th>
        <td><%=Html.Encode(Model.Model ?? "Unknown")%></td>
    </tr>
    <tr>
        <th>Purchase price</th>
        <td><%=Html.Encode(Model.PurchasePrice.ToString("0.00"))%> EUR</td>
    </tr>
    <tr>
        <th>License plate</th>
        <td><%=Html.Encode(Model.LicensePlate ?? "Unknown")%></td>
    </tr>
    <tr>
        <th>Fuel type</th>
        <td><%=Html.Encode(Model.FuelType ?? "Unknown")%></td>
    </tr>
    <tr>
        <th>Description</th>
        <td><%=Html.Encode(Model.Description ?? "Unknown")%></td>
    </tr>
</table>   
    <p>

        <%=Html.ActionLink("Refuellings...", "List", "Refuelling", new { licensePlate = Model.LicensePlate }, null)%>
        <%=Html.ActionLink("Edit...", "Edit", new { licensePlate = Model.LicensePlate })%>
    </p>
    
 
    <h3>Statistics</h3>
    
    <table border="0" cellpadding="2" cellspacing="0" class="vertical">
    <tr>
        <th>Total kilometers</th>
        <td><%=Html.Encode(Model.TotalKilometers.ToString("0"))%> km</td>
    </tr>
    <tr>
        <th>Average usage</th>
        <td><%=Html.Encode(Model.AverageUsage.ToString("0.00"))%> liters / 100 km</td>
    </tr>
    <tr>
        <th>Total costs</th>
        <td><%=Html.Encode(Model.TotalCost.ToString("0.00"))%> EUR</td>
    </tr>
    <tr>
        <th>Average costs per kilometer</th>
        <td><%=Html.Encode(Model.AverageCost.ToString("0.00"))%> EUR / km</td>
    </tr>
</table>
      
</asp:Content>

 

  